home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#07 (Mar 86)
/
Pascal 2-3
/
Small Flight Source
/
Small Flight.Asm
< prev
next >
Wrap
Assembly Source File
|
1986-02-13
|
5KB
|
284 lines
string_format 0
xdef PAS$Xfer
PAS$Xfer
jmp smallflight
xdef fontdata
fontdata ds.b 26
xdef fontptr
fontptr ds.b 4
xdef fontadj
fontadj ds.b 4
xdef patalign
patalign ds.b 4
xdef polymax
polymax ds.b 2
xdef thepoly
thepoly ds.b 4
xdef playindex
playindex ds.b 2
xdef playpic
playpic ds.b 4
xdef rgnmax
rgnmax ds.b 2
xdef rgnindex
rgnindex ds.b 2
xdef rgnbuf
rgnbuf ds.b 4
xdef widedata
widedata ds.b 10
xdef widemaster
widemaster ds.b 4
xdef wideopen
wideopen ds.b 4
xdef randseed
randseed ds.b 4
xdef screenbits
screenbits ds.b 14
xdef arrow
arrow ds.b 68
xdef dkgray
dkgray ds.b 8
xdef ltgray
ltgray ds.b 8
xdef gray
gray ds.b 8
xdef black
black ds.b 8
xdef white
white ds.b 8
xdef theport
theport ds.b 4
xdef stars
stars ds.b 1410
xdef bounds
bounds ds.b 8
xdef sorigin
sorigin ds.b 4
xdef myport
myport ds.b 108
xdef anevent
anevent ds.b 16
xdef makestar
makestar
link A6,#-4
movem.l A4/D7,-(SP)
movea.l 8(A6),A4
clr.w -(SP)
dc.w $A861
move.w (SP)+,D7
ext.l D7
divs.w #64,D7
swap D7
move.w D7,2(A4)
movea.l 8(A6),A4
clr.w -(SP)
dc.w $A861
move.w (SP)+,D7
ext.l D7
divs.w #64,D7
swap D7
move.w D7,(A4)
movea.l 8(A6),A4
move.w #200,4(A4)
movea.l 8(A6),A4
move.w 2(A4),D7
muls.w #200,D7
movea.l 8(A6),A4
ext.l D7
divs.w 4(A4),D7
move.w D7,-2(A6)
movea.l 8(A6),A4
move.w sorigin+2(A5),D7
add.w -2(A6),D7
move.w D7,8(A4)
movea.l 8(A6),A4
move.w (A4),D7
muls.w #200,D7
movea.l 8(A6),A4
ext.l D7
divs.w 4(A4),D7
move.w D7,-4(A6)
movea.l 8(A6),A4
move.w sorigin(A5),D7
add.w -4(A6),D7
move.w D7,6(A4)
movea.l 8(A6),A4
move.w 8(A4),-(SP)
movea.l 8(A6),A4
move.w 6(A4),-(SP)
jsr.w flippix
movem.l (SP)+,A4/D7
unlk A6
movea.l (SP)+,A0
addq.l #4,SP
jmp (A0)
xdef initialize
initialize
link A6,#-2
movem.l A4/D6/D7,-(SP)
lea theport(A5),A4
move.l A4,-(SP)
dc.w $A86E
lea myport(A5),A4
move.l A4,-(SP)
dc.w $A86F
dc.w $A850
move.l screenbits+6(A5),bounds(A5)
move.l screenbits+10(A5),bounds+4(A5)
pea bounds(A5)
move.w #25,-(SP)
move.w #30,-(SP)
dc.w $A8A9
move.w bounds+2(A5),D7
add.w bounds+6(A5),D7
ext.l D7
divs.w #2,D7
move.w D7,sorigin+2(A5)
move.w bounds(A5),D7
add.w bounds+4(A5),D7
ext.l D7
divs.w #2,D7
move.w D7,sorigin(A5)
pea myport+16(A5)
dc.w $A8A3
pea bounds(A5)
dc.w $A8A4
pea bounds(A5)
move.w sorigin+2(A5),D7
neg.w D7
move.w D7,-(SP)
move.w sorigin(A5),D7
neg.w D7
move.w D7,-(SP)
dc.w $A8A8
move.w #1,-2(A6)
move.w #140,D7
cmp.w -2(A6),D7
blt.w sl2il2
sl2il1
move.w -2(A6),D6
muls.w #10,D6
lea stars(A5),A4
pea (A4,D6.w)
jsr.w makestar
cmp.w -2(A6),D7
ble.w sl2il2
addq.w #1,-2(A6)
jmp sl2il1
sl2il2
movem.l (SP)+,A4/D6/D7
unlk A6
rts
xdef cycle
cycle
link A6,#-10
movem.l A3/A4/D5/D6/D7,-(SP)
move.w #1,-2(A6)
move.w #140,D7
cmp.w -2(A6),D7
blt.w sl3il2
sl3il1
move.w -2(A6),D6
muls.w #10,D6
lea stars(A5),A4
lea (A4,D6.w),A4
move.l A4,-10(A6)
movea.l -10(A6),A4
move.w 8(A4),-(SP)
movea.l -10(A6),A4
move.w 6(A4),-(SP)
jsr.w flippix
movea.l -10(A6),A4
movea.l -10(A6),A3
move.w 4(A3),D6
subq.w #4,D6
move.w D6,4(A4)
movea.l -10(A6),A4
cmpi.w #0,4(A4)
bgt.w sl3il3
movea.l -10(A6),A4
move.l A4,-(SP)
jsr.w makestar
jmp sl3il4
sl3il3
movea.l -10(A6),A4
move.w 2(A4),D6
muls.w #200,D6
movea.l -10(A6),A4
ext.l D6
divs.w 4(A4),D6
move.w D6,-6(A6)
movea.l -10(A6),A4
move.w sorigin+2(A5),D6
add.w -6(A6),D6
move.w D6,8(A4)
movea.l -10(A6),A4
move.w (A4),D6
muls.w #200,D6
movea.l -10(A6),A4
ext.l D6
divs.w 4(A4),D6
move.w D6,-4(A6)
movea.l -10(A6),A4
move.w sorigin(A5),D6
add.w -4(A6),D6
move.w D6,6(A4)
move.w -4(A6),D6
cmp.w bounds+4(A5),D6
sge.b D6
andi.w #1,D6
move.w -4(A6),D5
cmp.w bounds(A5),D5
sle.b D5
andi.w #1,D5
or.b D6,D5
move.w -6(A6),D6
cmp.w bounds+6(A5),D6
sge.b D6
andi.w #1,D6
or.b D5,D6
move.w -6(A6),D5
cmp.w bounds+2(A5),D5
sle.b D5
andi.w #1,D5
or.b D6,D5
beq.w sl3il5
movea.l -10(A6),A4
move.l A4,-(SP)
jsr.w makestar
jmp sl3il6
sl3il5
movea.l -10(A6),A4
move.w 8(A4),-(SP)
movea.l -10(A6),A4
move.w 6(A4),-(SP)
jsr.w flippix
sl3il6
sl3il4
cmp.w -2(A6),D7
ble.w sl3il2
addq.w #1,-2(A6)
jmp sl3il1
sl3il2
movem.l (SP)+,A3/A4/D5/D6/D7
unlk A6
rts
xdef smallflight
smallflight
link A6,#0
jsr.w initialize
move.w #-1,-(SP)
clr.w -(SP)
jsr.w flushevents
il1
jsr.w cycle
clr.b -(SP)
move.w #10,-(SP)
pea anevent(A5)
dc.w $A970
move.b (SP)+,D7
beq.w il1
dc.w $A9F4
xref flippix
xref flushevents